package com.founder.sample;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TodoItem {
	
	private String task;
	
	private Date created;
	
	public TodoItem(String task) {
		this(task, new Date());
	}
	
	public TodoItem(String task, Date created) {
		this.task = task;
		this.created = created;
	}

	public String getTask() {
		return task;
	}

	public Date getCreated() {
		return created;
	}
	
	public String toString() {
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
		String dateString = df.format(created);
		return "(" + dateString + ") " + task;
	}

}
